<?php
 
namespace StudyBuddy\Controllers;

use StudyBuddy\Request;
use StudyBuddy\Responder;

/**
 * This controller is called by Ajax call only
 * It's is called when user clicks on the sort tags
 * in the answer page to sort answers by recent, olderst, votes
 * It will return the parsed block of answers
 *
 */
class Getanswers extends Viewquestion
{
	protected $oQuestion;
	
	protected $oAnswers;
	
	protected function main(){
		$this->getQuestion()->getAnswers()->setReturn();
	}
	
	protected function setReturn(){
		Responder::sendJSON(array('paginated' => $this->answers));
	}
}
